/***************************************************************************
/
/ the StoryImageController class manages all the user actions related
/ to viewing each Image that is related to a story
/
/**************************************************************************/

class StoryImageController {


	//define the default redirection for the StoryImageController
    def index = { redirect( action:list, params:params ) }


    // the delete, save and update actions only accept POST requests
    def allowedMethods = [ delete:'POST', save:'POST', update:'POST' ]


	//show a specific Story Image record
    def show = {

		//get the approriate record based on the passed in id parameter
        def storyImage = StoryImage.get( params.id )

		//check we have a valid record
        if( !storyImage ) {

			//if the record is not found, return to the list page with en error message
            flash.message = "StoryImage not found with id ${params.id}"
            redirect( action : list )

        } else {

			//redirect to the 'view' page for this record
			return [ storyImage : storyImage ]

		}
    }


}